package com.design.template;

public abstract class AbstractWageCalculationTemplate {
    protected double salary;

    private final double social() {
        return this.salary * 0.07;
    }

    private final double accumulationFund() {
        return this.salary * 0.12;
    }

    protected abstract double personalIncomeTax(double salary);

    public final double calcuSalary(double salary) {
        this.salary = salary;
        return salary - (social() + accumulationFund() + personalIncomeTax(salary));
    }

}
